<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSalariesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('salaries', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户ID');
            $table->integer('project_id')->comment('项目ID');
            $table->integer('position_id')->comment('职位ID');
            $table->integer('pattern_id')->comment('记薪方案ID');
            $table->unsignedInteger('social_security_id')->index()->default(0)->comment('社保方案ID');
            $table->unsignedInteger('provident_fund_id')->index()->default(0)->comment('公积金方案ID');
            $table->string('debit', 20)->comment('银行卡号');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('salaries');
    }
}
